// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by google-apis-code-generator 1.5.1
//     C# generator version: 1.22.0
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

/**
 * \brief
 *   Google Analytics API Version v2.4
 *
 * \section ApiInfo API Version Information
 *    <table>
 *      <tr><th>API
 *          <td><a href='https://developers.google.com/analytics/'>Google Analytics API</a>
 *      <tr><th>API Version<td>v2.4
 *      <tr><th>API Rev<td>20170302 (791)
 *      <tr><th>API Docs
 *          <td><a href='https://developers.google.com/analytics/'>
 *              https://developers.google.com/analytics/</a>
 *      <tr><th>Discovery Name<td>analytics
 *    </table>
 *
 * \section ForMoreInfo For More Information
 *
 * The complete API documentation for using Google Analytics API can be found at
 * <a href='https://developers.google.com/analytics/'>https://developers.google.com/analytics/</a>.
 *
 * For more information about the Google APIs Client Library for .NET, see
 * <a href='https://developers.google.com/api-client-library/dotnet/get_started'>
 * https://developers.google.com/api-client-library/dotnet/get_started</a>
 */

namespace Google.Apis.Analytics.v2_4
{
    /// <summary>The Analytics Service.</summary>
    public class AnalyticsService : Google.Apis.Services.BaseClientService
    {
        /// <summary>The API version.</summary>
        public const string Version = "v2.4";

        /// <summary>The discovery version used to generate this service.</summary>
        public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed =
            Google.Apis.Discovery.DiscoveryVersion.Version_1_0;

        /// <summary>Constructs a new service.</summary>
        public AnalyticsService() :
            this(new Google.Apis.Services.BaseClientService.Initializer()) {}

        /// <summary>Constructs a new service.</summary>
        /// <param name="initializer">The service initializer.</param>
        public AnalyticsService(Google.Apis.Services.BaseClientService.Initializer initializer)
            : base(initializer)
        {
            data = new DataResource(this);
            management = new ManagementResource(this);
        }

        /// <summary>Gets the service supported features.</summary>
        public override System.Collections.Generic.IList<string> Features
        {
            get { return new string[0]; }
        }

        /// <summary>Gets the service name.</summary>
        public override string Name
        {
            get { return "analytics"; }
        }

        /// <summary>Gets the service base URI.</summary>
        public override string BaseUri
        {
            get { return "https://www.googleapis.com/analytics/v2.4/"; }
        }

        /// <summary>Gets the service base path.</summary>
        public override string BasePath
        {
            get { return "analytics/v2.4/"; }
        }

        /// <summary>Available OAuth 2.0 scopes for use with the Google Analytics API.</summary>
        public class Scope
        {
            /// <summary>View and manage your Google Analytics data</summary>
            public static string Analytics = "https://www.googleapis.com/auth/analytics";

            /// <summary>View your Google Analytics data</summary>
            public static string AnalyticsReadonly = "https://www.googleapis.com/auth/analytics.readonly";

        }



        private readonly DataResource data;

        /// <summary>Gets the Data resource.</summary>
        public virtual DataResource Data
        {
            get { return data; }
        }

        private readonly ManagementResource management;

        /// <summary>Gets the Management resource.</summary>
        public virtual ManagementResource Management
        {
            get { return management; }
        }
    }

    ///<summary>A base abstract class for Analytics requests.</summary>
    public abstract class AnalyticsBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse>
    {
        ///<summary>Constructs a new AnalyticsBaseServiceRequest instance.</summary>
        protected AnalyticsBaseServiceRequest(Google.Apis.Services.IClientService service)
            : base(service)
        {
        }

        /// <summary>Data format for the response.</summary>
        /// [default: atom]
        [Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<AltEnum> Alt { get; set; }

        /// <summary>Data format for the response.</summary>
        public enum AltEnum
        {
            /// <summary>Responses with Content-Type of application/atom+xml</summary>
            [Google.Apis.Util.StringValueAttribute("atom")]
            Atom,
        }

        /// <summary>Selector specifying which fields to include in a partial response.</summary>
        [Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Fields { get; set; }

        /// <summary>API key. Your API key identifies your project and provides you with API access, quota, and reports.
        /// Required unless you provide an OAuth 2.0 token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Key { get; set; }

        /// <summary>OAuth 2.0 token for the current user.</summary>
        [Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string OauthToken { get; set; }

        /// <summary>Returns response with indentations and line breaks.</summary>
        /// [default: false]
        [Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> PrettyPrint { get; set; }

        /// <summary>Available to use for quota purposes for server-side applications. Can be any arbitrary string
        /// assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.</summary>
        [Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string QuotaUser { get; set; }

        /// <summary>IP address of the site where the request originates. Use this if you want to enforce per-user
        /// limits.</summary>
        [Google.Apis.Util.RequestParameterAttribute("userIp", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UserIp { get; set; }

        /// <summary>Initializes Analytics parameter list.</summary>
        protected override void InitParameters()
        {
            base.InitParameters();

            RequestParameters.Add(
                "alt", new Google.Apis.Discovery.Parameter
                {
                    Name = "alt",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "atom",
                    Pattern = null,
                });
            RequestParameters.Add(
                "fields", new Google.Apis.Discovery.Parameter
                {
                    Name = "fields",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "key", new Google.Apis.Discovery.Parameter
                {
                    Name = "key",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "oauth_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "oauth_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "prettyPrint", new Google.Apis.Discovery.Parameter
                {
                    Name = "prettyPrint",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "false",
                    Pattern = null,
                });
            RequestParameters.Add(
                "quotaUser", new Google.Apis.Discovery.Parameter
                {
                    Name = "quotaUser",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "userIp", new Google.Apis.Discovery.Parameter
                {
                    Name = "userIp",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
        }
    }

    /// <summary>The "data" collection of methods.</summary>
    public class DataResource
    {
        private const string Resource = "data";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public DataResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Returns Analytics report data for a view (profile).</summary>
        /// <param name="ids">Unique table ID for retrieving report data. Table ID is of the form ga:XXXX, where XXXX is the
        /// Analytics view (profile) ID.</param>
        /// <param name="startDate">Start date for fetching report data. All
        /// requests should specify a start date formatted as YYYY-MM-DD.</param>
        /// <param name="endDate">End date for
        /// fetching report data. All requests should specify an end date formatted as YYYY-MM-DD.</param>
        /// <param
        /// name="metrics">A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric
        /// must be specified to retrieve a valid Analytics report.</param>
        public virtual GetRequest Get(string ids, string startDate, string endDate, string metrics)
        {
            return new GetRequest(service, ids, startDate, endDate, metrics);
        }

        /// <summary>Returns Analytics report data for a view (profile).</summary>
        public class GetRequest : AnalyticsBaseServiceRequest<string>
        {
            /// <summary>Constructs a new Get request.</summary>
            public GetRequest(Google.Apis.Services.IClientService service, string ids, string startDate, string endDate, string metrics)
                : base(service)
            {
                Ids = ids;
                StartDate = startDate;
                EndDate = endDate;
                Metrics = metrics;
                InitParameters();
            }


            /// <summary>Unique table ID for retrieving report data. Table ID is of the form ga:XXXX, where XXXX is the
            /// Analytics view (profile) ID.</summary>
            [Google.Apis.Util.RequestParameterAttribute("ids", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Ids { get; private set; }

            /// <summary>Start date for fetching report data. All requests should specify a start date formatted as
            /// YYYY-MM-DD.</summary>
            [Google.Apis.Util.RequestParameterAttribute("start-date", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string StartDate { get; private set; }

            /// <summary>End date for fetching report data. All requests should specify an end date formatted as YYYY-
            /// MM-DD.</summary>
            [Google.Apis.Util.RequestParameterAttribute("end-date", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string EndDate { get; private set; }

            /// <summary>A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one
            /// metric must be specified to retrieve a valid Analytics report.</summary>
            [Google.Apis.Util.RequestParameterAttribute("metrics", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Metrics { get; private set; }

            /// <summary>A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'.</summary>
            [Google.Apis.Util.RequestParameterAttribute("dimensions", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Dimensions { get; set; }

            /// <summary>A comma-separated list of dimension or metric filters to be applied to the report
            /// data.</summary>
            [Google.Apis.Util.RequestParameterAttribute("filters", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Filters { get; set; }

            /// <summary>The maximum number of entries to include in this feed.</summary>
            [Google.Apis.Util.RequestParameterAttribute("max-results", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<int> MaxResults { get; set; }

            /// <summary>An Analytics advanced segment to be applied to the report data.</summary>
            [Google.Apis.Util.RequestParameterAttribute("segment", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Segment { get; set; }

            /// <summary>A comma-separated list of dimensions or metrics that determine the sort order for the report
            /// data.</summary>
            [Google.Apis.Util.RequestParameterAttribute("sort", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Sort { get; set; }

            /// <summary>An index of the first entity to retrieve. Use this parameter as a pagination mechanism along
            /// with the max-results parameter.</summary>
            /// [minimum: 1]
            [Google.Apis.Util.RequestParameterAttribute("start-index", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<int> StartIndex { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "get"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "data"; }
            }

            /// <summary>Initializes Get parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "ids", new Google.Apis.Discovery.Parameter
                    {
                        Name = "ids",
                        IsRequired = true,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"ga:[0-9]+",
                    });
                RequestParameters.Add(
                    "start-date", new Google.Apis.Discovery.Parameter
                    {
                        Name = "start-date",
                        IsRequired = true,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"[0-9]{4}-[0-9]{2}-[0-9]{2}",
                    });
                RequestParameters.Add(
                    "end-date", new Google.Apis.Discovery.Parameter
                    {
                        Name = "end-date",
                        IsRequired = true,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"[0-9]{4}-[0-9]{2}-[0-9]{2}",
                    });
                RequestParameters.Add(
                    "metrics", new Google.Apis.Discovery.Parameter
                    {
                        Name = "metrics",
                        IsRequired = true,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"ga:.+",
                    });
                RequestParameters.Add(
                    "dimensions", new Google.Apis.Discovery.Parameter
                    {
                        Name = "dimensions",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"(ga:.+)?",
                    });
                RequestParameters.Add(
                    "filters", new Google.Apis.Discovery.Parameter
                    {
                        Name = "filters",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"ga:.+",
                    });
                RequestParameters.Add(
                    "max-results", new Google.Apis.Discovery.Parameter
                    {
                        Name = "max-results",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "segment", new Google.Apis.Discovery.Parameter
                    {
                        Name = "segment",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "sort", new Google.Apis.Discovery.Parameter
                    {
                        Name = "sort",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = @"(-)?ga:.+",
                    });
                RequestParameters.Add(
                    "start-index", new Google.Apis.Discovery.Parameter
                    {
                        Name = "start-index",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }
    }

    /// <summary>The "management" collection of methods.</summary>
    public class ManagementResource
    {
        private const string Resource = "management";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public ManagementResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;
            accounts = new AccountsResource(service);
            goals = new GoalsResource(service);
            profiles = new ProfilesResource(service);
            segments = new SegmentsResource(service);
            webproperties = new WebpropertiesResource(service);

        }

        private readonly AccountsResource accounts;

        /// <summary>Gets the Accounts resource.</summary>
        public virtual AccountsResource Accounts
        {
            get { return accounts; }
        }

        /// <summary>The "accounts" collection of methods.</summary>
        public class AccountsResource
        {
            private const string Resource = "accounts";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public AccountsResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Lists all accounts to which the user has access.</summary>
            public virtual ListRequest List()
            {
                return new ListRequest(service);
            }

            /// <summary>Lists all accounts to which the user has access.</summary>
            public class ListRequest : AnalyticsBaseServiceRequest<string>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service)
                    : base(service)
                {
                    InitParameters();
                }


                /// <summary>The maximum number of accounts to include in this response.</summary>
                [Google.Apis.Util.RequestParameterAttribute("max-results", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> MaxResults { get; set; }

                /// <summary>An index of the first account to retrieve. Use this parameter as a pagination mechanism
                /// along with the max-results parameter.</summary>
                /// [minimum: 1]
                [Google.Apis.Util.RequestParameterAttribute("start-index", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> StartIndex { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "management/accounts"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "max-results", new Google.Apis.Discovery.Parameter
                        {
                            Name = "max-results",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "start-index", new Google.Apis.Discovery.Parameter
                        {
                            Name = "start-index",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
        private readonly GoalsResource goals;

        /// <summary>Gets the Goals resource.</summary>
        public virtual GoalsResource Goals
        {
            get { return goals; }
        }

        /// <summary>The "goals" collection of methods.</summary>
        public class GoalsResource
        {
            private const string Resource = "goals";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public GoalsResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Lists goals to which the user has access.</summary>
            /// <param name="accountId">Account ID to retrieve goals for. Can either be a specific account ID or '~all', which
            /// refers to all the accounts that user has access to.</param>
            /// <param name="webPropertyId">Web property ID to
            /// retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that
            /// user has access to.</param>
            /// <param name="profileId">View (Profile) ID to retrieve goals for. Can either be a
            /// specific view (profile) ID or '~all', which refers to all the views (profiles) that user has access to.</param>
            public virtual ListRequest List(string accountId, string webPropertyId, string profileId)
            {
                return new ListRequest(service, accountId, webPropertyId, profileId);
            }

            /// <summary>Lists goals to which the user has access.</summary>
            public class ListRequest : AnalyticsBaseServiceRequest<string>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string accountId, string webPropertyId, string profileId)
                    : base(service)
                {
                    AccountId = accountId;
                    WebPropertyId = webPropertyId;
                    ProfileId = profileId;
                    InitParameters();
                }


                /// <summary>Account ID to retrieve goals for. Can either be a specific account ID or '~all', which
                /// refers to all the accounts that user has access to.</summary>
                [Google.Apis.Util.RequestParameterAttribute("accountId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string AccountId { get; private set; }

                /// <summary>Web property ID to retrieve goals for. Can either be a specific web property ID or '~all',
                /// which refers to all the web properties that user has access to.</summary>
                [Google.Apis.Util.RequestParameterAttribute("webPropertyId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string WebPropertyId { get; private set; }

                /// <summary>View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or
                /// '~all', which refers to all the views (profiles) that user has access to.</summary>
                [Google.Apis.Util.RequestParameterAttribute("profileId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string ProfileId { get; private set; }

                /// <summary>The maximum number of goals to include in this response.</summary>
                [Google.Apis.Util.RequestParameterAttribute("max-results", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> MaxResults { get; set; }

                /// <summary>An index of the first goal to retrieve. Use this parameter as a pagination mechanism along
                /// with the max-results parameter.</summary>
                /// [minimum: 1]
                [Google.Apis.Util.RequestParameterAttribute("start-index", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> StartIndex { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "accountId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "accountId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "webPropertyId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "webPropertyId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "profileId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "profileId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "max-results", new Google.Apis.Discovery.Parameter
                        {
                            Name = "max-results",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "start-index", new Google.Apis.Discovery.Parameter
                        {
                            Name = "start-index",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
        private readonly ProfilesResource profiles;

        /// <summary>Gets the Profiles resource.</summary>
        public virtual ProfilesResource Profiles
        {
            get { return profiles; }
        }

        /// <summary>The "profiles" collection of methods.</summary>
        public class ProfilesResource
        {
            private const string Resource = "profiles";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public ProfilesResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Lists views (profiles) to which the user has access.</summary>
            /// <param name="accountId">Account ID for the views (profiles) to retrieve. Can either be a specific account ID or
            /// '~all', which refers to all the accounts to which the user has access.</param>
            /// <param
            /// name="webPropertyId">Web property ID for the views (profiles) to retrieve. Can either be a specific web property ID
            /// or '~all', which refers to all the web properties to which the user has access.</param>
            public virtual ListRequest List(string accountId, string webPropertyId)
            {
                return new ListRequest(service, accountId, webPropertyId);
            }

            /// <summary>Lists views (profiles) to which the user has access.</summary>
            public class ListRequest : AnalyticsBaseServiceRequest<string>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string accountId, string webPropertyId)
                    : base(service)
                {
                    AccountId = accountId;
                    WebPropertyId = webPropertyId;
                    InitParameters();
                }


                /// <summary>Account ID for the views (profiles) to retrieve. Can either be a specific account ID or
                /// '~all', which refers to all the accounts to which the user has access.</summary>
                [Google.Apis.Util.RequestParameterAttribute("accountId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string AccountId { get; private set; }

                /// <summary>Web property ID for the views (profiles) to retrieve. Can either be a specific web property
                /// ID or '~all', which refers to all the web properties to which the user has access.</summary>
                [Google.Apis.Util.RequestParameterAttribute("webPropertyId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string WebPropertyId { get; private set; }

                /// <summary>The maximum number of views (profiles) to include in this response.</summary>
                [Google.Apis.Util.RequestParameterAttribute("max-results", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> MaxResults { get; set; }

                /// <summary>An index of the first entity to retrieve. Use this parameter as a pagination mechanism
                /// along with the max-results parameter.</summary>
                /// [minimum: 1]
                [Google.Apis.Util.RequestParameterAttribute("start-index", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> StartIndex { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "accountId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "accountId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "webPropertyId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "webPropertyId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "max-results", new Google.Apis.Discovery.Parameter
                        {
                            Name = "max-results",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "start-index", new Google.Apis.Discovery.Parameter
                        {
                            Name = "start-index",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
        private readonly SegmentsResource segments;

        /// <summary>Gets the Segments resource.</summary>
        public virtual SegmentsResource Segments
        {
            get { return segments; }
        }

        /// <summary>The "segments" collection of methods.</summary>
        public class SegmentsResource
        {
            private const string Resource = "segments";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public SegmentsResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Lists advanced segments to which the user has access.</summary>
            public virtual ListRequest List()
            {
                return new ListRequest(service);
            }

            /// <summary>Lists advanced segments to which the user has access.</summary>
            public class ListRequest : AnalyticsBaseServiceRequest<string>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service)
                    : base(service)
                {
                    InitParameters();
                }


                /// <summary>The maximum number of advanced segments to include in this response.</summary>
                [Google.Apis.Util.RequestParameterAttribute("max-results", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> MaxResults { get; set; }

                /// <summary>An index of the first advanced segment to retrieve. Use this parameter as a pagination
                /// mechanism along with the max-results parameter.</summary>
                /// [minimum: 1]
                [Google.Apis.Util.RequestParameterAttribute("start-index", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> StartIndex { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "management/segments"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "max-results", new Google.Apis.Discovery.Parameter
                        {
                            Name = "max-results",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "start-index", new Google.Apis.Discovery.Parameter
                        {
                            Name = "start-index",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
        private readonly WebpropertiesResource webproperties;

        /// <summary>Gets the Webproperties resource.</summary>
        public virtual WebpropertiesResource Webproperties
        {
            get { return webproperties; }
        }

        /// <summary>The "webproperties" collection of methods.</summary>
        public class WebpropertiesResource
        {
            private const string Resource = "webproperties";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public WebpropertiesResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Lists web properties to which the user has access.</summary>
            /// <param name="accountId">Account ID to retrieve web properties for. Can either be a specific account ID or '~all',
            /// which refers to all the accounts that user has access to.</param>
            public virtual ListRequest List(string accountId)
            {
                return new ListRequest(service, accountId);
            }

            /// <summary>Lists web properties to which the user has access.</summary>
            public class ListRequest : AnalyticsBaseServiceRequest<string>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string accountId)
                    : base(service)
                {
                    AccountId = accountId;
                    InitParameters();
                }


                /// <summary>Account ID to retrieve web properties for. Can either be a specific account ID or '~all',
                /// which refers to all the accounts that user has access to.</summary>
                [Google.Apis.Util.RequestParameterAttribute("accountId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string AccountId { get; private set; }

                /// <summary>The maximum number of web properties to include in this response.</summary>
                [Google.Apis.Util.RequestParameterAttribute("max-results", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> MaxResults { get; set; }

                /// <summary>An index of the first entity to retrieve. Use this parameter as a pagination mechanism
                /// along with the max-results parameter.</summary>
                /// [minimum: 1]
                [Google.Apis.Util.RequestParameterAttribute("start-index", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> StartIndex { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "management/accounts/{accountId}/webproperties"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "accountId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "accountId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "max-results", new Google.Apis.Discovery.Parameter
                        {
                            Name = "max-results",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "start-index", new Google.Apis.Discovery.Parameter
                        {
                            Name = "start-index",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
    }
}

namespace Google.Apis.Analytics.v2_4.Data
{
}
